<%--
  Created by IntelliJ IDEA.
  User: Lenovo
  Date: 2025/5/4
  Time: 16:07
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ page import="com.project.DB_User" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.List" %>
<%
    String uid = request.getParameter("uid");
    String name = request.getParameter("name");
    String pid = request.getParameter("pid");
    String email = request.getParameter("email");
    String phone = request.getParameter("phone");
    String identity = request.getParameter("identity");
    String isRegistered = request.getParameter("is_registered");
    String password = request.getParameter("password");

    List<String> updateInput = new ArrayList<>();
    updateInput.add(uid);
    updateInput.add(name);
    updateInput.add(pid);
    updateInput.add(email);
    updateInput.add(phone);
    updateInput.add(identity);
    updateInput.add(isRegistered);
    updateInput.add(password);

    DB_User dbUser = new DB_User();
    boolean updateResult = dbUser.update(updateInput);
    if (updateResult) {
        response.sendRedirect("index.jsp");
    } else {
        out.println("更新用户失败");
    }
%>